/////////////////////////////////////////////////////////////////////////////////////
// Include Files
#include "Interfaces\Listener.h"

#include "Event\Notification.h"

/////////////////////////////////////////////////////////////////////////////////////
// IListener Implementation

void IListener::ProcessEvents()
{
	// process all notifications in the list, more may be added while looping
	m_NotMutex.Lock();
	for( uint_t i = 0; i < m_lstNots.GetSize(); ++i )
	{
		ABCNotification *pNot = m_lstNots[i];
		m_NotMutex.Unlock();

		// process and then delete this notification
		pNot->Process(this);
		delete pNot;

		m_NotMutex.Lock();
	}

	// clear the list
	m_lstNots.Clear();
	m_NotMutex.Unlock();
}
